home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / doom / server_1.zip / _INIT.QC < prev    next >
Text File  |  1996-10-04  |  2KB  |  81 lines

  1. /*
  2. **
  3. ** _init.qc (Init Code, 1.0)
  4. **
  5. ** Copyright (C) 1996 Johannes Plass
  6. ** 
  7. ** This program is free software; you can redistribute it and/or modify
  8. ** it under the terms of the GNU General Public License as published by
  9. ** the Free Software Foundation; either version 2 of the License, or
  10. ** (at your option) any later version.
  11. ** 
  12. ** This program is distributed in the hope that it will be useful,
  13. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. ** GNU General Public License for more details.
  16. **
  17. ** You should have received a copy of the GNU General Public License
  18. ** along with this program; if not, write to the Free Software
  19. ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. ** 
  21. ** Author:   Johannes Plass (plass@dipmza.physik.uni-mainz.de)
  22. **
  23. */
  24.  
  25. void(entity player) InitInfo =
  26. {
  27.    if (!USE_MODULE_INIT) return;
  28.    // nothing to do here
  29. };
  30.  
  31. void(entity player) InitInit =
  32. {
  33.    if (!USE_MODULE_INIT) return;
  34.    stuffcmd(player,"alias init-nextcall \"impulse 208\";\n");
  35.    stuffcmd(player,"alias init-nextskin \"impulse 209\";\n");
  36. };
  37.  
  38. void(entity player) InitActiveMessage =
  39. {
  40.   if (!USE_MODULE_INIT) return;
  41.   
  42.               // 123456789#123456789#123456789#12345678
  43.   sprint(player,"  Init\n");
  44. };
  45.  
  46. float(entity player) InitCallIsPermitted =
  47. {
  48.    if (!USE_MODULE_INIT) {
  49.         //           123456789#123456789#123456789#12345678
  50.       sprint(player,"init: error: init calls are not\n");
  51.       sprint(player,"      allowed on this server.\n");
  52.       return(0);
  53.    }
  54.    if (player.player_status & PLAYER_PASSED_INIT_PHASE) {
  55.       sprint(player,"init: error: can execute init calls\n");
  56.       sprint(player,"      only during initialization.\n");
  57.       return(0);
  58.    }
  59.    player.init_calls_executed = player.init_calls_executed + 1;
  60.    if (player.init_calls_executed > 40) {
  61.       sprint(player,"init: error: cannot execute more\n");
  62.       sprint(player,"      than 40 init-calls.\n");
  63.       return(0);
  64.    }
  65.    return(1);
  66. };
  67.  
  68. void(entity player) InitLetClientExecInit =
  69. {
  70.    if (!USE_MODULE_INIT) return;
  71.  
  72.    sprint(player,"Trying to execute command 'init'\n");
  73.    stuffcmd(player,"init;\n");
  74. };
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.